Dynomotion

Group: DynoMotion Message: 6553 From: bluetoad559 Date: 1/23/2013
Subject: VB apps and KmotionCNC
Hi, I'm looking to explore how VB apps and KmotionCNC talk to each other. I'm not sure why. LOL In my mind I see some possible benefits of perhaps, if it's possible, displaying the spindle current/temperature or inputting user entered data, who knows.

I saw this reply from November and got excited: "You could write a simple Windows .exe application in VB or C# to display a dialog, get the values, then set them in KFLOP UserData variables, then launch a C program and exit. This .exe could be Launched from a KMotionCNC User Button. (from here: http://tech.groups.yahoo.com/group/DynoMotion/message/6105 )

(I have VB6 installed; also have VS2008 but have never loaded it, it's still new in the unsealed package. LOL)

I found the jogger folder and loaded the example and went through it. (It's been years since my brief encounter with VB so I'm very rusty.) I saw the form and module but it complains about not finding KMViaVB when I try to run it. I seem to remember I have to either set paths or register controls/dlls or something; and I found 2 versions of the dll file in the installation directory, regular vanilla and debug. Is there any writeup, detailed examples or 5-minute youtube videos (I can dream can't I, LOL) showing any of this? Thanks
Group: DynoMotion Message: 6557 From: Tom Kerekes Date: 1/23/2013
Subject: Re: VB apps and KmotionCNC
Hi,
Please load your VS2008.  What Version of KMotion are you using?  Try Version KMotion430j.  The VB example should run out of the box.
Regards
TK

Group: DynoMotion Message: 6558 From: daveymahomh600e Date: 1/23/2013
Subject: Re: VB apps and KmotionCNC
Hi Folks,

I am still very much interested in this, but am having great difficulty understanding which parts of the example code to use to input my three values.

David

--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi,
> Please load your VS2008.  What Version of KMotion are you using?  Try Version KMotion430j.  The VB example should run out of the box.
> Regards
> TK
>
>
> ________________________________
> From: bluetoad559
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, January 23, 2013 8:08 AM
> Subject: [DynoMotion] VB apps and KmotionCNC
>
>  
> Hi, I'm looking to explore how VB apps and KmotionCNC talk to each other. I'm not sure why. LOL In my mind I see some possible benefits of perhaps, if it's possible, displaying the spindle current/temperature or inputting user entered data, who knows.
>
> I saw this reply from November and got excited: "You could write a simple Windows .exe application in VB or C# to display a dialog, get the values, then set them in KFLOP UserData variables, then launch a C program and exit. This .exe could be Launched from a KMotionCNC User Button. (from here: http://tech.groups.yahoo.com/group/DynoMotion/message/6105 )
>
> (I have VB6 installed; also have VS2008 but have never loaded it, it's still new in the unsealed package. LOL)
>
> I found the jogger folder and loaded the example and went through it. (It's been years since my brief encounter with VB so I'm very rusty.) I saw the form and module but it complains about not finding KMViaVB when I try to run it. I seem to remember I have to either set paths or register controls/dlls or something; and I found 2 versions of the dll file in the installation directory, regular vanilla and debug. Is there any writeup, detailed examples or 5-minute youtube videos (I can dream can't I, LOL) showing any of this? Thanks
>
Group: DynoMotion Message: 6562 From: Shannon Davenport Date: 1/23/2013
Subject: Re: VB apps and KmotionCNC

I'm running a 3+ axis servo machine out of VB6.  I modified the C code to expose the DLL's to COM.   If you do a search in this forum I think you will find the info you seek.
Shannon

On Jan 23, 2013 11:08 AM, "bluetoad559" <bluetoad559@...> wrote:
 

Hi, I'm looking to explore how VB apps and KmotionCNC talk to each other. I'm not sure why. LOL In my mind I see some possible benefits of perhaps, if it's possible, displaying the spindle current/temperature or inputting user entered data, who knows.

I saw this reply from November and got excited: "You could write a simple Windows .exe application in VB or C# to display a dialog, get the values, then set them in KFLOP UserData variables, then launch a C program and exit. This .exe could be Launched from a KMotionCNC User Button. (from here: http://tech.groups.yahoo.com/group/DynoMotion/message/6105 )

(I have VB6 installed; also have VS2008 but have never loaded it, it's still new in the unsealed package. LOL)

I found the jogger folder and loaded the example and went through it. (It's been years since my brief encounter with VB so I'm very rusty.) I saw the form and module but it complains about not finding KMViaVB when I try to run it. I seem to remember I have to either set paths or register controls/dlls or something; and I found 2 versions of the dll file in the installation directory, regular vanilla and debug. Is there any writeup, detailed examples or 5-minute youtube videos (I can dream can't I, LOL) showing any of this? Thanks

Group: DynoMotion Message: 6567 From: Tom Kerekes Date: 1/23/2013
Subject: Re: VB apps and KmotionCNC
Hi David,

What 3 values are you talking about and what you are trying to do?

But basically you can get and put 32-bit numbers to/from KFLOP using the Get/SetPersistDec Script commands.

There are also some .NET helper functions called 

        public int GetUserData(int index)
        public void SetUserData(int index, int data)

 Regards
TK



Group: DynoMotion Message: 6568 From: David Stevenson Date: 1/23/2013
Subject: Re: VB apps and KmotionCNC

Hi Tom,
 
I am trying to input width, pullback and stepover values (all doubles) into the probing routine that is mentioned in the post bluetoad provided the link for. I have a C program connected to a User Button that starts the probe program. My dream is to have a window popup which has boxes for these values, which are entered and then passed to the C probing program.
 
Because I'm not a programmer, it's confusing how to make this happen.
 
Thanks,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Wednesday, January 23, 2013 4:29 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: VB apps and KmotionCNC

 

Hi David,

What 3 values are you talking about and what you are trying to do?

But basically you can get and put 32-bit numbers to/from KFLOP using the Get/SetPersistDec Script commands.

There are also some .NET helper functions called 

        public int GetUserData(int index)
        public void SetUserData(int index, int data)

 Regards
TK



Group: DynoMotion Message: 6569 From: bluetoad559 Date: 1/23/2013
Subject: Re: VB apps and KmotionCNC
I'm running version 430e. I'll load the newer j version and the VS2008. Thanks





--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi,
> Please load your VS2008.  What Version of KMotion are you using?  Try Version KMotion430j.  The VB example should run out of the box.
> Regards
> TK
>
>
> ________________________________
> From: bluetoad559
> To: DynoMotion@yahoogroups.com
> Sent: Wednesday, January 23, 2013 8:08 AM
> Subject: [DynoMotion] VB apps and KmotionCNC
>
>  
> Hi, I'm looking to explore how VB apps and KmotionCNC talk to each other. I'm not sure why. LOL In my mind I see some possible benefits of perhaps, if it's possible, displaying the spindle current/temperature or inputting user entered data, who knows.
>
> I saw this reply from November and got excited: "You could write a simple Windows .exe application in VB or C# to display a dialog, get the values, then set them in KFLOP UserData variables, then launch a C program and exit. This .exe could be Launched from a KMotionCNC User Button. (from here: http://tech.groups.yahoo.com/group/DynoMotion/message/6105 )
>
> (I have VB6 installed; also have VS2008 but have never loaded it, it's still new in the unsealed package. LOL)
>
> I found the jogger folder and loaded the example and went through it. (It's been years since my brief encounter with VB so I'm very rusty.) I saw the form and module but it complains about not finding KMViaVB when I try to run it. I seem to remember I have to either set paths or register controls/dlls or something; and I found 2 versions of the dll file in the installation directory, regular vanilla and debug. Is there any writeup, detailed examples or 5-minute youtube videos (I can dream can't I, LOL) showing any of this? Thanks
>
Group: DynoMotion Message: 6571 From: Tom Kerekes Date: 1/23/2013
Subject: Re: VB apps and KmotionCNC
Hi David,

The first step would be to write a small Windows application with a screen for the User to enter the 3 values. You might start with the SimpleFormsCS C# application.  Change the screen to add the 3 input cells.

Then when the User pushes a button the values can be placed into KFLOP using 3 calls to:

       public void SetUserDataDouble(int index, double ddata)


The example also includes a button to compile/download/execute a C program in KFLOP.  That can be used to run your probing program that will make use of the 3 values.

HTH
Regards
TK

Group: DynoMotion Message: 6572 From: David Stevenson Date: 1/23/2013
Subject: Re: VB apps and KmotionCNC

Hi Tom,
 
Wait, you lost me after "The first step.." .  :o)
 
Can I use C# 2010 Express to modify the sample form?
 
Thanks,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Wednesday, January 23, 2013 4:55 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: VB apps and KmotionCNC

 

Hi David,

The first step would be to write a small Windows application with a screen for the User to enter the 3 values. You might start with the SimpleFormsCS C# application.  Change the screen to add the 3 input cells.

Then when the User pushes a button the values can be placed into KFLOP using 3 calls to:

       public void SetUserDataDouble(int index, double ddata)


The example also includes a button to compile/download/execute a C program in KFLOP.  That can be used to run your probing program that will make use of the 3 values.

HTH
Regards
TK

Group: DynoMotion Message: 6573 From: Tom Kerekes Date: 1/23/2013
Subject: Re: VB apps and KmotionCNC
Hi David,

Yes you can use VS 2010 C# Express.

Regards
TK

Group: DynoMotion Message: 6575 From: David Stevenson Date: 1/23/2013
Subject: Re: VB apps and KmotionCNC

Thanks Tom.
 
I will give it a try.
 
David
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Wednesday, January 23, 2013 5:30 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: VB apps and KmotionCNC

 

Hi David,

Yes you can use VS 2010 C# Express.

Regards
TK

Group: DynoMotion Message: 6717 From: David Stevenson Date: 2/13/2013
Subject: Re: VB apps and KmotionCNC

Hi Tom,
 
What's the best way to run a Windows.exe program with a User Button?
 
Thanks,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Wednesday, January 23, 2013 5:30 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: VB apps and KmotionCNC

 

Hi David,

Yes you can use VS 2010 C# Express.

Regards
TK

Group: DynoMotion Message: 6718 From: Tom Kerekes Date: 2/13/2013
Subject: Re: VB apps and KmotionCNC
Hi David,

You can assign it just like a .c program.  If it has a .exe extension it will be executed as a Windows program on the PC.

Regards
TK

Group: DynoMotion Message: 6719 From: David Stevenson Date: 2/13/2013
Subject: Re: VB apps and KmotionCNC

Hi Tom,
 
Do you need a board connected? I tried using ExecutePC but the .exe's only lockup the system.
 
Thanks,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Wednesday, February 13, 2013 4:38 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: VB apps and KmotionCNC

 

Hi David,

You can assign it just like a .c program.  If it has a .exe extension it will be executed as a Windows program on the PC.

Regards
TK

Group: DynoMotion Message: 6720 From: Tom Kerekes Date: 2/13/2013
Subject: Re: VB apps and KmotionCNC
Hi David,

My mistake.  I think the program is actually running but the screen is being intentionally hidden.  If you look in task manager you will probably see it running and if you terminate it control will return to KMotionCNC.  In some cases it is appropriate to run as a hidden application if you want to do something like IO or send an email with out any user interaction.  I can't think of an easy workaround without adding a new option.  I suppose you could write a Windows program to launch a Windows program?

Regards
TK

 

Group: DynoMotion Message: 6721 From: Tom Kerekes Date: 2/13/2013
Subject: Re: VB apps and KmotionCNC
Hi David,

This seems to work:

Create a batch file called c:\launch.bat of something like:

c:\KMotion430k\KMotion\Release\SimpleFormsCS.exe

Then assign c:\launch.bat to the ExecutePC User button

The batch file gets launched as a hidden program, which then launches SimpleFormsCS as a visible application.

Regards
TK


Group: DynoMotion Message: 6722 From: Tom Kerekes Date: 2/13/2013
Subject: Re: VB apps and KmotionCNC
Hi David,

Also in the Windows batch file you can start applications without waiting for them to exit with

start c:\KMotion430l\KMotion\Release\SimpleFormsCS.exe

Regards
TK

Group: DynoMotion Message: 6726 From: David Stevenson Date: 2/13/2013
Subject: Re: VB apps and KmotionCNC

Hi Tom,
 
Thank you. I'll give that a try.
 
David
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Wednesday, February 13, 2013 7:02 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: VB apps and KmotionCNC

 

Hi David,

Also in the Windows batch file you can start applications without waiting for them to exit with

start c:\KMotion430l\KMotion\Release\SimpleFormsCS.exe

Regards
TK

Group: DynoMotion Message: 6728 From: David Stevenson Date: 2/14/2013
Subject: Re: VB apps and KmotionCNC

Hi Tom,
 
The batch file works... sorta. Sometimes it will load the apps without problem, but often it will put up an error window and then load the app anyway. Also with folder names often having spaces in them these days, the bat files won't run programs with the spaces in the path description. It's kind of flaky.
 
Regards,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Wednesday, February 13, 2013 7:02 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: VB apps and KmotionCNC

 

Hi David,

Also in the Windows batch file you can start applications without waiting for them to exit with

start c:\KMotion430l\KMotion\Release\SimpleFormsCS.exe

Regards
TK

Group: DynoMotion Message: 6730 From: Tom Kerekes Date: 2/14/2013
Subject: Re: VB apps and KmotionCNC
Hi David,

If a file name has spaces try putting quotes around it.

Regards
TK


Group: DynoMotion Message: 6733 From: David Stevenson Date: 2/14/2013
Subject: Re: VB apps and KmotionCNC

Hi Tom,
 
That does help.
 
Thanks,
David.
 
-----Original Message-----
From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com]On Behalf Of Tom Kerekes
Sent: Thursday, February 14, 2013 12:32 PM
To: DynoMotion@yahoogroups.com
Subject: Re: [DynoMotion] Re: VB apps and KmotionCNC

 

Hi David,

If a file name has spaces try putting quotes around it.

Regards
TK